package com.googlecode.intellimars.sabotter.action;

import com.googlecode.intellimars.sabotter.SabotterPlugin;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.DataKeys;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.IconLoader;

public class SignOutAction extends AnAction {
    public SignOutAction() {
      getTemplatePresentation().setIcon(IconLoader.getIcon("/actions/exit.png"));
    }

    public void actionPerformed(AnActionEvent e) {
        Project project = DataKeys.PROJECT.getData(e.getDataContext());
        if (project != null) {
            SabotterPlugin plugin = project.getComponent(SabotterPlugin.class);
            plugin.signOut();
        }
    }
}
